home *** CD-ROM | disk | FTP | other *** search
- --= WID = SIMTEL20 Ada Software Repository Item Description File = WID =--
- -- WIS TOOL NUMBER : WIS_TOOL_29
- -- LOCATION : ASR
- -- CATEGORY LEVEL 1 : COMPONENTS
- -- CATEGORY LEVEL 2 : DYNAMIC STRINGS
- -- CATEGORY LEVEL 3 : DYNAMIC STRING 3
- -- CATEGORY LEVEL 4 :
- -- INDEX : String
- -- INDEX : Dynamic String
- -- INDEX : String, Dynamic
- -- TAXONOMY : !Joint Applications!Text Processing, Command Language, Design and Analysis!Dynamic String 3
- -- DEPENDENCIES :
- -- SEE ALSO :
- --= ABSTRACT ===============================================--
- -- 1. TOOL NAME : Dynamic String Package
- -- 2. TOOL NUMBER : 29-1
- --
- -- 3. CONTRACTOR :
- -- 3a CONTRACT # : Not Applicable
- -- 3b NAME : WIS JPMO
- -- 3c LOCATION : Washington D.C.
- -- 203306600
- -- 3d POC : Richard G. Cleaveland
- -- (703)285-5071
- --
- -- 4. TOOL DESCRIPTION :
- -- This is a package of several string manipulation functions based on
- -- a built-in dynamic string type DYN_STRING. It is an adaptation and
- -- extension of the package proposed by Sylvan Rubin of Ford Aerospace and
- -- Communications Corporation in the Nov/Dec 1984 issue of the Journal of
- -- Pascal, Ada and Modula-2. Some new functions have been added, and much
- -- of the body code has been rewritten.
- --
- -- 5. SCHEDULE :
- -- 5a PDR/CDR : N/A / First_build 07 DEC 84
- -- 5b DELIVERY : 18 MAR 85
- -- 5c DISTRIBUTION : 20 August 1985 GTE, IBM, NOSC, SIMTEL20
- --
- -- 6. CHARACTERISTICS :
- -- 6a DEVELOPMENT APPROACH : Recode algorithm from Journal of Pascal,
- -- Ada, and Modula-2
- -- 6b HOST MACHINE : WICAT
- -- 6c OPERATING SYSTEM : ROS
- -- 6d COMPILER : Telesoft 1.5 (unvalidated)
- -- 6e DEPENDENCIES :
- -- Implementation initially with the Telesoft Ada version 1.3.
- -- This required definition of the DYN_STRING type without use of a
- -- discriminant; an arbitrary maximum string length was chosen. This
- -- should be changed when an improved compiler is available.
- -- 6f NUMBER OF STATEMENTS : 177
- --
- -- 7. DOCUMENTATION : Source code
- -- 8. PORTABILITY : Compiled on VMS with DEC Ada, executed, mods
- -- of discriminants and 8 other modifications.
- --
- -- 9. WIS USE :
- -- 9a FOUNDATION AREA : Text Processing, Command Language, Design & Analysis
- -- 9b WIS USE AREA : Joint Applications
- -- 10. COMMENTS :
- -- type DYN_STRING is private;
- -- STRING_TOO_SHORT: exception;
- -- function D_STRING(CHAR: character) return DYN_STRING;
- -- -- Creates a one-byte dynamic string of contents CHAR.
- -- function D_STRING(STR : string ) return DYN_STRING;
- -- -- Creates a dynamic string of contents STR.
- -- function D_STRING(N: integer;
- -- B: natural := 0;
- -- F: character:= ' ') return DYN_STRING;
- -- function D_STRING(N: long_integer;
- -- B: natural := 0;
- -- F: character:= ' ') return DYN_STRING;
- -- -- for the two preceding functions,
- -- -- B is the number of bytes desired in the returned string. The
- -- -- first byte is reserved for the sign; it will be blank
- -- -- or '-'. If B is 0 or unspecified the length of the
- -- -- string returned is just enough for the sign and the
- -- -- significant digits. If the number would overflow B,
- -- -- the exception STRING_TOO_SHORT is raised.
- -- -- F is a leading-fill character. If B is not zero, bytes from 2
- -- -- up to the first significant byte will be F.
- -- function D_STRING(FLT : float; AFT : integer) return DYN_STRING;
- -- -- Creates a dynamic string representationof the number FLT
- -- -- in fixed point notation with AFT decimal places.
- -- -- The following four functions convert from dynamic strings to the
- -- -- desired representation:
- -- function CHAR(DSTR: DYN_STRING) return character;
- -- function STR (DSTR: DYN_STRING) return string;
- -- function INT (DSTR: DYN_STRING) return integer;
- -- function FLT (DSTR: DYN_STRING) return float;
- -- -- (No function LI as yet)
- --
- --
- -- function LENGTH(DSTR: DYN_STRING) return natural;
- -- function "<" (DS1, DS2: DYN_STRING) return boolean;
- -- function "&" (DS1, DS2: DYN_STRING) return DYN_STRING;
- -- function SUBSTRING (DSTR: DYN_STRING;-- Returns a subpart
- -- START : natural;-- starting at this position
- -- LENGTH : natural)-- and of this length.
- -- return DYN_STRING;
- -- function RIGHT (DSTR: DYN_STRING; -- Returns the part
- -- START : natural) -- starting here and to the end
- -- return DYN_STRING;
- -- function INDEX (SOURCE_STRING, --If this string contains
- -- PATTERN_STRING: DYN_STRING;
- -- --this string starting at or AFTER
- -- START_POS: integer) --this position, the position of
- -- return integer; --such start is returned.
- -- -- If the string lengths prohibit the search -1 is returned.
- -- -- If no match was found, 0 is returned.
- -- -- (This is like the INSTR function of BASIC).
- -- function RINDEX (SOURCE_STRING, --If this string contains
- -- PATTERN_STRING: DYN_STRING; --this string starting at or BEFORE
- -- START_POS: integer) --this position, the position of
- -- return integer; --such start is returned.
- -- -- If the string lengths prohibit the search -1 is returned.
- -- -- If no match was found, 0 is returned.
- -- function UPPERCASE (DSTR: DYN_STRING) return DYN_STRING;
- -- -- Returns with all lower-case characters changed to
- -- -- uppercase.
- -- 11. LAST CHANGE TO DATA : 21 March 1986.
- --= FILE LISTING ===============================================--
- -- FILE SPECS : PD:<ADA.COMPONENTS>DSTR3*.*
- -- DIRECTORY DISPLAY :
- -- Directory PD:<ADA.COMPONENTS>
- -- File Name Byte Count Line Count
- -- --------------- ---------- ----------
- -- DSTR3.ABS 6272 128
- -- DSTR3.CMM 2068 53
- -- DSTR3.PRO 4559 89
- -- DSTR3.SRC 16707 487
- -- DSTR3.TST 7261 267
- -- =============== ========== ==========
- -- 5 Files 36867 1024
- --= DISCLAIMER ===============================================--
- -- This software and its documentation are provided "AS IS" and
- -- without any expressed or implied warranties whatsoever. No warranties
- -- as to performance, merchantability, or fitness for a particular
- -- purpose exist.
- -- The user is advised to test the software thoroughly before
- -- relying on it. The user must assume the entire risk and liability of
- -- using this software. In no event shall any person or organization of
- -- people be held responsible for any direct, indirect, consequential or
- -- inconsequential damages or lost profits.
- --======================================================================--
-